package com.ydj.app.entity;

import com.ydj.framework.mysql.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import javax.persistence.*;
import java.util.Date;

@Getter
@Setter
@Entity
@Accessors(chain = true)
@Table(name = "cms_account",
        indexes = {@Index(name = "idx_username", columnList = "username")},
        uniqueConstraints = {@UniqueConstraint(name = "uni_username", columnNames = {"username"})})
@org.hibernate.annotations.Table(appliesTo = "cms_account", comment = "CMS-账号表")
public class CmsAccount extends BaseEntity {
    @Column(columnDefinition = "varchar(64) comment '用户名'", unique = true, nullable = false)
    private String username;

    @Column(columnDefinition = "varchar(64) comment '名字'")
    private String name;

    @Column(columnDefinition = "varchar(50) comment '密码'", nullable = false)
    private String password;

    @Column(columnDefinition = "varchar(32) comment '最后登录的 IP'")
    private String lastLoginIp;

    @Column(columnDefinition = "datetime comment '最后登录时间'")
    private Date lastLoginTime;

    @Column(columnDefinition = "tinyint default 1 comment '是否启用'")
    private Boolean enable;

}